from selenium import webdriver
import time
import os
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome()
url = "file:///"+os.path.abspath("C:\\课件\\我的课件\\测试\\selenium2/locateElement/selenium2html/drop_down.html")
driver.get(url)
driver.maximize_window()
time.sleep(3)
# xpath
# driver.find_element_by_xpath("//*[@id='ShippingMethod']/option[4]").click()
options = driver.find_elements_by_tag_name("option")
# for option in options:
#     if option.get_attribute('value') == '9.03':
#         option.click()
options[3].click()
time.sleep(6)
driver.quit()

